<template>
  <el-carousel indicator-position="none">
    <el-carousel-item v-for="(item, index) in list" :key="index">
      <div class="banner"><img :src="item.imgUrl" /></div>
    </el-carousel-item>
  </el-carousel>
</template>
<script>
import axios from "@/uitls/request.js";
export default {
  data() {
    return {
      list: [],
    };
  },
  created() {
    this.getbanner();
  },
  methods: {
    getbanner() {
      axios({
        url: `gateway?cityId=510100&k=722417`,
        data: {
          xHost: `mall.cfg.film-float.banner`,
        },
      }).then((res) => {
        if (res.status == 0) {
          this.list.push(res.data);
        }
      });
    },
  },
};
</script>
<style scoped lang='less'>
.el-carousel__item .banner {
  color: #475669;
  font-size: 18px;
  height: 200px;
  margin: 0;
  img {
    width: 100%;
    height: 100%;
  }
}
.el-carousel--horizontal {
  height: 4rem !important;
}
/deep/ .el-carousel__container {
  height: 4rem !important;
}
.el-carousel__item:nth-child(2n) {
  background-color: #99a9bf;
}

.el-carousel__item:nth-child(2n + 1) {
  background-color: #d3dce6;
}
</style>
